package com.dmbjz.ssmdemo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

//声明扫描mapper接口
@MapperScan(basePackages = "com.dmbjz")
@SpringBootApplication
public class SsmDemoApplication {

	public static void main(String[] args) {

		//写法1
		//SpringApplication.run(SsmDemoApplication.class, args);


/*
			//写法2  程序化指定的参数，优先级低于配置文件方式
			SpringApplication application = new SpringApplication(SsmDemoApplication.class);
			application.setBannerMode(Banner.Mode.CONSOLE);

			//调整 SpringApplication 的参数
			//application.setDefaultProperties();

			application.run(args);
*/

		new SpringApplicationBuilder()
				.sources(SsmDemoApplication.class)
				.bannerMode(Banner.Mode.OFF)
				//指定配置信息
				.properties("server.port=9182")
				.run(args);


	}

}
